﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Text;
using System.Threading.Tasks;

namespace BaseNet.Core.Utils
{
    /// <summary>
    /// whereif扩展
    /// </summary>
    public static class WhereIfExtension
    {
        public static List<T> WhereIf<T>(this List<T> source, bool condition, Predicate<T> predicate)
        {
            return condition ? source.FindAll(predicate) : source;
        }
    }
}
